class User1 {
  // 构造函数是不能标注的
  constructor(
    public id: number,
    public username: string
  ) {
  }

  postArticle(title: string, content: string) {
    console.log(`${this.username}发表一篇文章:${title}`);
  }
}

class VIP extends User1 {
  constructor(
    id: number,
    username: string,
    public scope = 0
  ) {
    super(id, username);
    console.log('子类构造函数');
  }

  // 方法重写
  // 参数类型和个数相同
  postArticle(title: string, content: string) {
    console.log('这个方法已经重写');
  }

  // 方法重载
  // 参数类型和个数不同
}

let vip = new VIP(1, '继承');
console.log(vip);
